#ifndef SOCKS5_ACTION_CONNECT_H
#define SOCKS5_ACTION_CONNECT_H
#pragma once

#include "S5Action.h"

class S5ActionClient;

class S5ActionConnect : public S5Action {
public:
    explicit S5ActionConnect(S5ActionClient *client) : m_client(client) {}
public:
    bool isProxy() const { return true; }
    void relay(const void *data, size_t length, const KIAddress *dest);
protected:
    void abortImp();
    void onConnected();
    void onError(KDef::SockError type, DWORD error);
    void onReceived(KKey *&key, void *data, size_t length, bool more);
    void onSent(KKey *&key, void *data, size_t length);
private:
    S5ActionClient *m_client;
};

#endif // SOCKS5_ACTION_CONNECT_H